<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui-date,auto-complete,dtvalidate,layui,chosen'}){%>
    <style type="text/css">
        body{padding-top:10px;
            padding-left: 10px;}
        *{margin:0;padding:0;list-style-type:none;}
        a,img{border:0;}
        .demo h2{font-size:16px;color:#3366cc;height:30px;}
        .demo li{float:left;}
    </style>
    <%}%>
</head>

<body>
<div class="row">
    <div class="col-sm-12">
        <!-- START 右侧数据 -->
        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
            <div class="ibox-content" style="padding:15px 20px 0px 20px;">
                <form id="search-form" role="form" class="form-horizontal" autocomplete="off">
                    <input type="hidden" readonly id="receiveMember" name="receiveMember" class="form-control" value="${user.userRealname}">
                    <div class="form-group">
                        <label class="control-label col-sm-1">开始时间:</label>
                        <div class="col-sm-2">
                            <input type="text" id="beginDate" name="beginDate" placeholder="请选择会计期间" class="form-control">
                        </div>
                        <label class="control-label col-sm-1">结束时间:</label>
                        <div class="col-sm-2">
                            <input type="text" id="endDate" name="endDate" placeholder="请选择会计期间" class="form-control">
                        </div>
                        <label class="control-label col-sm-1">SKU:</label>
                        <div class="col-sm-2">
                            <input type="text" id="createSku" name="createSku" class="form-control">
                        </div>
                        <label class="control-label col-sm-1">渠道:</label>
                        <div class="col-sm-2">
                            <select id="createChannelName" name="createChannelName"  class="form-control">
                                <option value="">请选择</option>
                                <%for(var dict in channel){%>
                                <option value="${dict.channelName}">${dict.channelName}</option>
                                <%}%>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">

                        <label class="control-label col-sm-1">柜号:</label>
                        <div class="col-sm-2">
                            <input type="text" id="createPlanNo" name="createPlanNo" class="form-control">
                        </div>
                        <label class="control-label col-sm-1">shipmentId:</label>
                        <div class="col-sm-2">
                            <input type="text" id="createShipmentId" name="createShipmentId" class="form-control">
                        </div>
                        <label class="control-label col-sm-1">状态:</label>
                        <div class="col-sm-2">
                            <select id="createPlanStatus" name="createPlanStatus"  class="form-control">
                                <option value="">请选择</option>
                                <option value="1">未处理</option>
                                <option value="2">已分配</option>
                                <option value="3">已发运</option>
                                <option value="4">已开船</option>
                                <option value="5">已清关</option>
                                <option value="6">已送货</option>
                                <option value="7">已入库</option>
                            </select>
                        </div>
                        <a class="search-btn btn btn-success" style="margin-bottom: 0px;">查询</a>
                    </div>
                </form>
            </div>
            <!-- START 操作按钮 -->
            <form>
                <div id="toolbar" class="btn-group" style="margin-bottom:5px;">
                    <button  class="export-btn layui-btn  layui-btn-sm" style="margin-left: -2px">
                        <i class="fa fa-download" aria-hidden="true"></i> 导出当前数据
                    </button>
                </div>
            </form>
            <!-- END 操作按钮 -->

            <!-- START 数据表格 -->
            <table id="relatedTable"
                   data-toolbar="#toolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-resizable="true"
                   data-url="/sea/physical/despatch/getReport.do"
                   data-page-size="15"
                   class="table table-striped table-hover"
            >
            </table>
            <!-- END 数据表格 -->
        </div>
    </div>
</div>
<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,bootstrap-table-zh-CN,dtvalidate,dtvalidate-lang-zh_cn,laydate,layer,layui,chosen,chosen-demo,upload'}){}%>
<script>
    laydate.render({
        elem: '#beginDate' //指定元素
        ,trigger: 'click'
    });
    laydate.render({
        elem: '#endDate' //指定元素
        ,trigger: 'click'
    });
    var $relatedTable = $('#relatedTable');
    $(function(){
        //START 表格配置
        $relatedTable.bootstrapTable({
            columns: [
                {
                    title: '柜号',
                    field: 'createPlanNo',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '状态',
                    field: 'createPlanStatus',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '渠道',
                    field: 'createChannelName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: 'SKU',
                    field: 'createSku',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '运输方式',
                    field: 'createPlanTransport',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: 'ShipmentId',
                    field: 'createShipmentId',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    field: 'productName',
                    title: '产品名称',
                    align: 'center'
                },

                {
                    title: '计划数量',
                    field: 'createNumber',
                    align: 'center',
                    valign: 'middle'
                },

                {
                    title: '发运数量',
                    field: 'createNewNumber',
                    align: 'center',
                    valign: 'middle'
                },

                {
                    title: '供应商',
                    field: 'createSupplierName',
                    align: 'center',
                    valign: 'middle'
                },

                {
                    title: '发运港',
                    field: 'despatchPortName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '目的港',
                    field: 'despatchDestName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '目的港仓库',
                    field: 'despatchStoreName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '发运时间',
                    field: 'boatDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '开船时间',
                    field: 'driveBoatDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '清关时间',
                    field: 'clearDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '送货时间',
                    field: 'sendDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '入库时间',
                    field: 'stockDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '货代公司',
                    field: 'despatchSupplier',
                    align: 'center',
                    valign: 'middle'
                }
            ],
            onLoadSuccess : function(){

            }
        });

        $('.search-btn').on('click',function(){
            $relatedTable.bootstrapTable('refresh', { url:'${ctxPath}/sea/physical/despatch/getReport.do?'+$('#search-form').serialize() });
        });
    });



    $(".export-btn").click(function () {
        window.location.href='/sea/physical/despatch/exportReport.do?'+$('#search-form').serialize();
    });
</script>
</body>
</html>
